import Vue from "vue";
import VueRouter from "vue-router";
Vue.use(VueRouter);
import stationRouter from "./modules/station.js";
// import pointRouter from "./modules/point.js";
let routes = [
  {
    path: "/login",
    name: "login",
    component: () => import("@/views/login/waterLogin.vue")
  },
  // 防汛指挥模式
  {
    path: "/flood",
    name: "flood",
    component: () => import("@/views/flood/prevention.vue")
  },
  // 首页
  {
    path: "/",
    name: "Home",
    component: () => import("@/views/Home.vue"),
    redirect: "/home/map",
    children: [
      {
        path: "/home/map",
        name: "map",
        component: () => import("@/views/map/map.vue"),
        meta: {
          title: "首页"
        }
      }
    ]
  },
  // 水位站列表
  stationRouter,
  // 积水点列表
  // pointRouter,
  // 水位站监测
  {
    path: "/waterstation",
    component: () => import("@/views/Home.vue"),
    redirect: "/Waterstation/stationVideos",
    children: [
      {
        path: "/waterstation/stationVideos",
        name: "StationVideos",
        component: () => import("../views/stationVideos/index"),
        meta: {
          title: "水位站监控总览"
        }
      },
      {
        path: "/Waterstation/datastation",
        name: "Datastation",
        component: () => import("../views/datastation/index"),
        meta: {
          title: "水位站数据统计"
        }
      }
    ]
  },
  // 积水点监测
  {
    path: "/waterpoint",
    component: () => import("@/views/Home.vue"),
    redirect: "/waterpoint/pointVideos",
    children: [
     
      {
        path: "/waterpoint/pointVideos",
        name: "PointVideos",
        component: () => import("../views/pointVideos/index"),
        meta: {
          title: "积水点监控总览"
        }
      },
      {
        path: "/waterpoint/datapoint",
        name: "Datapoint",
        component: () => import("../views/datapoint/index"),
        meta: {
          title: "积水点数据统计"
        }
      },
      {
        path: "/waterpoint/pointlist",
        name: "Pointlist",
        component: () => import("../views/pointlist/index"),
        meta: {
          title: "积水点列表"
        }
      },
    ]
  },
  // 短信预警
  {
    path: "/message",
    component: () => import("@/views/Home.vue"),
    redirect: "/message/receive",
    children: [
      {
        path: "/message/receive",
        name: "Receive",
        component: () => import("../views/receive/index"),
        meta: {
          title: "短信接收人"
        }
      },
      {
        path: "/message/sendRecord",
        name: "SendRecord",
        component: () => import("../views/sendRecord/index"),
        meta: {
          title: "发送记录"
        }
      }
    ]
  },
  // 告警记录
  {
    path: "/Warnrecord",
    component: () => import("@/views/Home.vue"),
    redirect: "/warnrecord/index",
    children: [
      {
        path: "/warnrecord/index",
        name: "Warnrecord",
        component: () => import("../views/warnrecord/index"),
        meta: {
          title: "告警记录"
        }
      }
    ]
  },
  // 设备管理
  {
    path: "/equipment",
    component: () => import("@/views/Home.vue"),
    redirect: "/equipment/siteMange",
    children: [
      {
        path: "/equipment/siteMange",
        name: "SiteMange",
        component: () => import("../views/siteMange/index"),
        meta: {
          title: "站点管理"
        }
      },
      {
        path: "/equipment/solarEnergyMange",
        name: "SolarEnergyMange",
        component: () => import("../views/solarEnergyMange/index"),
        meta: {
          title: "太阳能设备管理"
        }
      },
      {
        path: "/equipment/waterLevelMange",
        name: "WaterLevelMange",
        component: () => import("../views/waterLevelMange/index"),
        meta: {
          title: "水位设备管理"
        }
      },
      {
        path: "/equipment/videoMange",
        name: "VideoMange",
        component: () => import("../views/videoMange/index"),
        meta: {
          title: "监控设备管理"
        }
      }
    ]
  },
  // 系统管理
  {
    path: "/system",
    component: () => import("@/views/Home.vue"),
    redirect: "/system/structure",
    children: [
      {
        path: "/system/structure",
        name: "Structure",
        component: () => import("../views/structure/index"),
        meta: {
          title: "组织结构"
        }
      },
      {
        path: "/system/users",
        name: "Users",
        component: () => import("../views/users/index"),
        meta: {
          title: "用户管理"
        }
      },
      {
        path: "/system/roles",
        name: "Roles",
        component: () => import("../views/roles/index"),
        meta: {
          title: "角色管理"
        }
      }
    ]
  },
  // 操作日志
  {
    path: "/operationlogs",
    component: () => import("@/views/Home.vue"),
    redirect: "/operationlogs/index",
    children: [
      {
        path: "/operationlogs/index",
        name: "Operationlogs",
        component: () => import("../views/operationlogs/index"),
        meta: {
          title: "操作日志"
        }
      }
    ]
  }
];
const router = new VueRouter({
  base: process.env.BASE_URL,
  scrollBehavior: () => ({
    x: 0,
    y: 0
  }),
  routes
});
export default router;
